import { userStore } from "@/store/user";
export default function hasParm(value: any) {
    const store = userStore()
    //当前用户拥有的权限字段
    const permission = store.getCodeList;
    if (value && value instanceof Array && value.length > 0) {
        //按钮所需的权限字段
        const permissonRoles = value;
        //判断是否存在按钮所需的权限
        const hasPermisson = permission.some((role) => {
            return permissonRoles.includes(role)
        })
        return hasPermisson
    } else {
        throw new Error('v-if="global.$hasPerm("[\'add\',\'edit\']")')
    }
}